<script setup lang="ts">

import {computed, ref} from "vue";
import {useStore} from "vuex";

const store = useStore()
const value = computed(()=> store.getters["auth/getActiveTab"])
const handleChange = (name:string)=>{
  store.dispatch("auth/setActiveTab",name)
  uni.switchTab({
    url:`/pages/${name}/index`
  })
}
</script>

<template>
  <u-tabbar
      :value="value"
      @change="handleChange"
      :fixed="true"
      :placeholder="true"
      :safeAreaInsetBottom="true"
  >
    <u-tabbar-item text="首页" icon="home" name="index" @click="handleChange"></u-tabbar-item>
<!--    <u-tabbar-item text="放映厅" icon="photo" ></u-tabbar-item>-->
<!--    <u-tabbar-item text="直播" icon="play-right" ></u-tabbar-item>-->
    <u-tabbar-item text="我的" icon="account" name="mine" @click="handleChange"></u-tabbar-item>
  </u-tabbar>
</template>

<style scoped>

</style>